<template>
  <Scroll class="sub-scroll" ref="scroll">
    <div class="subCategoryList">
      <li class="list-item"  v-for="(item,index) in subCategoryList" :key="index">
        <a :href="item.link">
          <img :src="item.image" @load="imgLoadOk" alt="">
        </a>
        <p>{{item.title}}</p>
    </li>
  </div>
  </Scroll>
  
</template>
<script>
import Scroll from '../../../components/common/scroll/Scroll'
export default {
  name:'SubCategory',
  components:{
    Scroll,
  },
  props:{
    subCategoryList:{
      type:Array,
      default:function(){
        return []
      }
    }
  },
  methods: {
    imgLoadOk:function(){
      this.$refs.scroll.refresh();
    }
  },
}
</script>
<style scoped>
.sub-scroll{
  height:100%;
}
.subCategoryList{
  display: flex;
  flex-wrap: wrap;
  padding: 10px;
  justify-content: space-between;
}
.list-item{
  list-style: none;
  display: flex;
  flex-direction: column;
  
  
}
.list-item img{
  width:65px;
}
p{
  text-align: center;
  width: 65px;
  
}
</style>